Dynomotion

Group: DynoMotion Message: 7954 From: Steve Date: 7/17/2013
Subject: Using the last two Kflop axis (non coordinated) any Caveats?

Ultimately, my goal is to move my ATC code to the Kfop and eliminate the need for a separate controller and potential conflicts with haveing more than one device com with MACH thru Modbus.

I did not plan to dig into this until next year sometime, but it occurs to me that while the homing process and other Kflop stuff is fresh in my mind, it makes sense to add that other axis now.

The target machine already uses XYZABC and Spindle, so I will be using the non-cordinated Kflop axis for the ATC arm and carousel (both servo driven).

I  have read thru the header and some sample programs and I think I can make the following assumptions:

1) that the additionbal axis are set up along with the others in the init program.

Question: what is the last function to add to initialize thes axis. The function that I am aware of will not go beyond 5.

2) that the tool change in MACH is passed as a persistent var and I can pick that up in the homeing program and execute from there.

Question: is there any advantage to creating a separate program for the ATC functions and not adding them to the homing program?

Undoubtedly there will be more specific questions on this process,  but for now I am looking for a 'best method' so that I do not go down the wrong road.

Thanks in advance for any answers or advice on this.

- Steve

 

 

 

 

.

Group: DynoMotion Message: 7955 From: Tom Kerekes Date: 7/17/2013
Subject: Re: Using the last two Kflop axis (non coordinated) any Caveats?
Hi Steve,

Sounds like a good project.

Regarding:

#1 - to configure/initialize axis channel #7 just use axis channel number 7.  I'm not sure I understand what you are asking.  You will probably not want to add the tool change axis to the coordinated motion system and move the axis from Mach3.  Instead Mach3 will just request what Tool is to be loaded and KFLOP will handle the details.  This may involve moving the Tool Change Motor with KFLOP C Code such as Move(7,XXX);

#2 - actually the tool change code would be added to the Notify program, not the Home Program.  Basically there is special support for Initialization (RESET), Homing, and Spindle where special things happen in/to the Plugin and those are passed to special programs.  Anything else is handled by the Notify program.  For any Mach3 macro that wants KFLOP to execute some C Code can execute a NotifyPlugins(XXX) where XXX is a unique message code that is passed by the Plugin to the Notify Program to tell the Notify Program what it should do.    So in your case you might change the Mach3 M6 (start and end) macros to do a NotifyPlugins(XXX) to tell KFLOP to change a tool.  If your tool changer only allows a few tool slots then you might encode the slot number in the message. ie 10001 = load tool #1, 10002 = load tool #2, etc...  Other wise you could download a DRO as the tool number.

HTH
Regards
TK

Group: DynoMotion Message: 7956 From: Steve Simpson Date: 7/17/2013
Subject: Re: Using the last two Kflop axis (non coordinated) any Caveats?
I referred to the additional axis as non-coordinated. My notes say that Kflop can coordinate 6 axis, but that is moot in this case as the ATC axis do not need to be coordinated with any other movements and I planned to do the entire tool change sequence in Kflop in response to an outside command and parameter.
 
My question was specificly about the function that initializes the axis at the end of the Init.c program;

DefineCoordSystem6(0,1,2,3,4,5);

Therefor QUESTION: is there a similar function call needed to initialize the last two axis?

Second issue is where to put the ATC sequence code. If the Notify program is the best spot, that's fine, but spindle homing is part part of the tool change sequence, so is there a mechanism by which the code running in 'Notify' can call the homing routine in the 'Home' program?

Actually, the best place to home the spindle is from the Spindle JOg program because it would simplify the process if the spindle simply homed every time it is turned off. Howver, that still requires calling the homing routine from outside, in this case frm the spindle jog program.

So second QUESTION: how do you call a routine in another program? Are they, or can they be made global? 

 

Lastly, you mentioned NotifyPlugins(XXX). I recall seeing some examples of this recently and I can look that up to get the syntax, etc.

 

QUESTION: is there a document that lists all of the available message codes?

 

Thanks for the help.

 

= Steve

 



On Wed, Jul 17, 2013 at 1:22 PM, Tom Kerekes <tk@...> wrote:
 

Hi Steve,

Sounds like a good project.

Regarding:

#1 - to configure/initialize axis channel #7 just use axis channel number 7.  I'm not sure I understand what you are asking.  You will probably not want to add the tool change axis to the coordinated motion system and move the axis from Mach3.  Instead Mach3 will just request what Tool is to be loaded and KFLOP will handle the details.  This may involve moving the Tool Change Motor with KFLOP C Code such as Move(7,XXX);

#2 - actually the tool change code would be added to the Notify program, not the Home Program.  Basically there is special support for Initialization (RESET), Homing, and Spindle where special things happen in/to the Plugin and those are passed to special programs.  Anything else is handled by the Notify program.  For any Mach3 macro that wants KFLOP to execute some C Code can execute a NotifyPlugins(XXX) where XXX is a unique message code that is passed by the Plugin to the Notify Program to tell the Notify Program what it should do.    So in your case you might change the Mach3 M6 (start and end) macros to do a NotifyPlugins(XXX) to tell KFLOP to change a tool.  If your tool changer only allows a few tool slots then you might encode the slot number in the message. ie 10001 = load tool #1, 10002 = load tool #2, etc...  Other wise you could download a DRO as the tool number.

HTH
Regards
TK

Group: DynoMotion Message: 7957 From: Tom Kerekes Date: 7/17/2013
Subject: Re: Using the last two Kflop axis (non coordinated) any Caveats?
Hi Steve,

The Call to:

0,1,2,3,4,5);

is not really initializing any axes.  It is more a mapping of GCode Axis Letters to KFLOP Axis Channels.  It defines which of the 8 available KFLOP Axis Channels are to be defined and included in the X Y Z A B C coordinate system.  Mach3 (and KMotionCNC) only support 6 simultaneous coordinated motion axes.  But they can be any of the Axis Channels in any order.  So for example to have a system with only X and Y using KFLOP Axis Channels 6 and 7 you could code:

DefineCoordSystem6(6,7,-1,-1,-1,-1);

 -1 indicates that the GCode Axis is unused.

BTW it is possible to problematically swap the axis channels around by using a Mach3 Macro (to do a NotifyPlugins to execute an new DefineCoordSystem6).

KFLOP is capable of doing 8 axes of simultaneous coordinated motion so there is a DefineCoordSystem8 where you can define all 8 channels.  But this requires a custom application such as Gerald's 8 axis camera motion controller.  It will not work with Mach3 and would not be useful to you.

The adition of your Tool Change should involve no changes in this regard.  Just configure the tool changer axis as axis channel 7 to be a servo or stepper or whatever.  Enable it.  Do not include it in the coordinated motion system.  Then command it to move using Move() and Jog() commands.


The ATC code will need to be part of the Notify.c program.  You can not easily call code in some other Program or Thread from another.  If some code that already exists in some other program (Home or Spindle) needs to be executed the simplest thing would be to just duplicate the code into the Notify.c Program.  Or to avoid having duplicated source code you can put the source code into a function in a separate C file and include it into multiple Programs using an #include statement.

Notify Message Numbers 10000 through 10999 are available for your use.

HTH
Regards
TK